import { TableColumnData } from "@arco-design/web-vue/es/table/interface";
import { TransferItem } from "@arco-design/web-vue/es/transfer/interface";

const t = translate("公共模块");

export const fixedFields: Array<TableColumnData> = [
  // { title: "index", dataIndex: "index", slotName: "index", width: 50 },
  { title: "店名", dataIndex: "storeName" },

  { title: "商品名称", dataIndex: "goodsName", slotName: "goodsName" },
  { title: "条形码", dataIndex: "barCode" },

  { title: "零售价", dataIndex: "retailPrice" },

  { title: "会员价", dataIndex: "memberPrice" },
  { title: "促销价", dataIndex: "salePrice" },
  { title: "二维码", dataIndex: "qrcodeUrl" },
  { title: "计价单位", dataIndex: "salesUnit" },
  { title: "等级", dataIndex: "grade" },
  { title: "产地", dataIndex: "origin" },

  { title: "保质期", dataIndex: "shelf_life" },
  { title: "规格", dataIndex: "specif" },
  { title: "库存", dataIndex: "stock" },
  { title: "货号", dataIndex: "item_no" },
  { title: "促销开始", dataIndex: "promotion_begin" },
  { title: "促销结束", dataIndex: "promotion_end" },
  { title: "生产日期", dataIndex: "production_date" },
  { title: "仓库", dataIndex: "warehouse" },
  { title: "仓位", dataIndex: "freight_space" },
  { title: "是否共享", dataIndex: "share" },
  // { title: "创建时间", dataIndex: "createTime" },

  //  Add this piece of code
  // { title: "扩展字段", dataIndex: "expands" },

  // { title: "ID", dataIndex: "goodsId" },
  { title: "刷新次数", dataIndex: "refreshTimes" },
  { title: "部门", dataIndex: "department" },
  {
    title: "操作",
    dataIndex: "optional",
    slotName: "optional",
    fixed: "right",
    width: 150
  }
];
const columns = ref<Array<TableColumnData>>([]);

export const transferColumns = (): TransferItem[] => {
  return fixedFields.map((e: any) => {
    return {
      label: t.value?.[e.title] || e.title,
      value: e.dataIndex,
      disabled: false
    };
  });
};

export default columns;
